<!DOCTYPE html>
<html lang="{{ DEFAULT_LANG }}">
<head>
        {% block head %}
        {% include 'analytics.html' %}
        <title>{% block title %}{{ SITENAME }}{% endblock title %}</title>
        <meta name="viewport" content="width=device-width, initial-scale=1" />
        <meta charset="utf-8" />
        {% if FEED_ALL_ATOM %}
        <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_ATOM_URL %}{{ FEED_ALL_ATOM_URL }}{% else %}{{ FEED_ALL_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Full Atom Feed" />
        {% endif %}
        {% if FEED_ALL_RSS %}
        <link href="{{ FEED_DOMAIN }}/{% if FEED_ALL_RSS_URL %}{{ FEED_ALL_RSS_URL }}{% else %}{{ FEED_ALL_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Full RSS Feed" />
        {% endif %}
        {% if FEED_ATOM %}
        <link href="{{ FEED_DOMAIN }}/{%if FEED_ATOM_URL %}{{ FEED_ATOM_URL }}{% else %}{{ FEED_ATOM }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Atom Feed" />
        {% endif %}
        {% if FEED_RSS %}
        <link href="{{ FEED_DOMAIN }}/{% if FEED_RSS_URL %}{{ FEED_RSS_URL }}{% else %}{{ FEED_RSS }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} RSS Feed" />
        {% endif %}
        {% if CATEGORY_FEED_ATOM and category %}
        <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_ATOM_URL %}{{ CATEGORY_FEED_ATOM_URL|format(category.slug) }}{% else %}{{ CATEGORY_FEED_ATOM|format(category.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Categories Atom Feed" />
        {% endif %}
        {% if CATEGORY_FEED_RSS and category %}
        <link href="{{ FEED_DOMAIN }}/{% if CATEGORY_FEED_RSS_URL %}{{ CATEGORY_FEED_RSS_URL|format(category.slug) }}{% else %}{{ CATEGORY_FEED_RSS|format(category.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Categories RSS Feed" />
        {% endif %}
        {% if TAG_FEED_ATOM and tag %}
        <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_ATOM_URL %}{{ TAG_FEED_ATOM_URL|format(tag.slug) }}{% else %}{{ TAG_FEED_ATOM|format(tag.slug) }}{% endif %}" type="application/atom+xml" rel="alternate" title="{{ SITENAME }} Tags Atom Feed" />
        {% endif %}
        {% if TAG_FEED_RSS and tag %}
        <link href="{{ FEED_DOMAIN }}/{% if TAG_FEED_RSS_URL %}{{ TAG_FEED_RSS_URL|format(tag.slug) }}{% else %}{{ TAG_FEED_RSS|format(tag.slug) }}{% endif %}" type="application/rss+xml" rel="alternate" title="{{ SITENAME }} Tags RSS Feed" />
        {% endif %}
        <!-- twitter card metadata -->
        {% block twittercard %}
        {% endblock twittercard %}
        <!-- OG Tags -->
        {% block ogtags %}
        {% endblock ogtags %}
        <!-- favicon -->
        {% if FAVICON %}
        <link rel="icon" type="image/png" href="{{ SITEURL }}/images/{{ FAVICON }}">
        {% endif %}
        <!-- moment.js for date formatting -->
        <script src="{{ SITEURL }}/theme/js/moment.js"></script>
        <!-- css -->
        <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/main.css" />
        <!-- 左边的menu，如果页面高度不够，就跟着滚动，否则文章分类显示不全 -->
        <link rel="stylesheet" type="text/css" href="{{ SITEURL }}/theme/css/mycss/menu.css" />
		<script>
			
                /*! grunt-grunticon Stylesheet Loader - v2.1.2 | https://github.com/filamentgroup/grunticon | (c) 2015 Scott Jehl, Filament Group, Inc. | MIT license. */
    
    (function(e){function t(t,n,r,o){"use strict";function a(){for(var e,n=0;u.length>n;n++)u[n].href&&u[n].href.indexOf(t)>-1&&(e=!0);e?i.media=r||"all":setTimeout(a)}var i=e.document.createElement("link"),l=n||e.document.getElementsByTagName("script")[0],u=e.document.styleSheets;return i.rel="stylesheet",i.href=t,i.media="only x",i.onload=o||null,l.parentNode.insertBefore(i,l),a(),i}var n=function(r,o){"use strict";if(r&&3===r.length){var a=e.navigator,i=e.Image,l=!(!document.createElementNS||!document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGRect||!document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image","1.1")||e.opera&&-1===a.userAgent.indexOf("Chrome")||-1!==a.userAgent.indexOf("Series40")),u=new i;u.onerror=function(){n.method="png",n.href=r[2],t(r[2])},u.onload=function(){var e=1===u.width&&1===u.height,a=r[e&&l?0:e?1:2];n.method=e&&l?"svg":e?"datapng":"png",n.href=a,t(a,null,null,o)},u.src="",document.documentElement.className+=" grunticon"}};n.loadCSS=t,e.grunticon=n})(this);(function(e,t){"use strict";var n=t.document,r="grunticon:",o=function(e){if(n.attachEvent?"complete"===n.readyState:"loading"!==n.readyState)e();else{var t=!1;n.addEventListener("readystatechange",function(){t||(t=!0,e())},!1)}},a=function(e){return t.document.querySelector('link[href$="'+e+'"]')},c=function(e){var t,n,o,a,c,i,u={};if(t=e.sheet,!t)return u;n=t.cssRules?t.cssRules:t.rules;for(var l=0;n.length>l;l++)o=n[l].cssText,a=r+n[l].selectorText,c=o.split(");")[0].match(/US\-ASCII\,([^"']+)/),c&&c[1]&&(i=decodeURIComponent(c[1]),u[a]=i);return u},i=function(e){var t,o,a;o="data-grunticon-embed";for(var c in e)if(a=c.slice(r.length),t=n.querySelectorAll(a+"["+o+"]"),t.length)for(var i=0;t.length>i;i++)t[i].innerHTML=e[c],t[i].style.backgroundImage="none",t[i].removeAttribute(o);return t},u=function(t){"svg"===e.method&&o(function(){i(c(a(e.href))),"function"==typeof t&&t()})};e.embedIcons=i,e.getCSS=a,e.getIcons=c,e.ready=o,e.svgLoadedCallback=u,e.embedSVG=u})(grunticon,this);
                
                grunticon(["{{ SITEURL }}/theme/css/icons.data.svg.css", "{{ SITEURL }}/theme/css/icons.data.png.css", "{{ SITEURL }}/theme/css/icons.fallback.css"]);
            </script>
        <noscript><link href="{{ SITEURL }}/theme/css/icons.fallback.css" rel="stylesheet"></noscript>
        <!-- menu toggle javascript -->
        <script type="text/javascript">
            document.addEventListener("DOMContentLoaded", initMenu);
            
            function initMenu(){
                var menu = document.getElementById("menu");
                var menulink = document.getElementById("menu-link");
                menulink.addEventListener("click", function toggleMenu(){
                        window.event.preventDefault();
                        menulink.classList.toggle('active');
                        menu.classList.toggle('active');              
                    });
            };
        </script>
        <!-- 不蒜子 -->
        <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
        {% endblock head %}
</head>
<body>
    {% include 'github.html' %}
    {% block header %}
    <div role="banner" id="masthead">
        <header>
            {% if GRAVATAR %}
            <a href="/"><img src="{{ GRAVATAR }}" alt="Matt McManus Avatar" class="gravatar"></a>
            {% elif LOGO %}
            <a href="/"><img src="{{ SITEURL }}/images/{{ LOGO }}" alt="McManus Logo"></a>
                {% if FIRST_NAME %}
                <h1>{{ SITENAME }}@{{ FIRST_NAME }}</h1>
                {% endif %}
            {% else %}
            <h1><a href="/">{{ FIRST_NAME }}'s Blog</a></h1>
            {% endif %}
            <a href="#menu" id="menu-link">more stuff</a>
            <nav id="menu">
                <ul>
                    {% if DISPLAY_PAGES_ON_MENU %}
                      {% for p in pages %}
                        <li{% if p == page %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ p.url }}">{{ p.slug }}</a></li>
                      {% endfor %}
                    {% endif %}
                    {% for title, link in MENUITEMS %}
                        <li><a href="{{ link }}">{{ title }}</a></li>
                    {% endfor %}
                    {% if DISPLAY_CATEGORIES_ON_MENU %}
                        {% for cat, null in categories %}
                            {% if cat != "misc" %}
                            <li{% if cat == category %} class="active"{% endif %}><a href="{{ SITEURL }}/{{ cat.url }}">{{ cat }}</a></li>
                            {% endif %}
                        {% endfor %}
                    {% endif %}
                </ul>
            </nav>
        </header>
    </div>
    {% endblock header %}
        <div class="page" role="main">
            {% block content %}
            {% endblock content %}
            {% block footer %}
                <footer>
                    <div class="icons">
                        {% if TWITTER %}
                        <a href="{{ TWITTER }}" target="_blank"><div class="icon-twitter icon"></div></a>
                        {% endif %}
                        {% if GITHUB %}
                        <a href="{{ GITHUB }}" target="_blank"><div class="icon-github icon"></div></a>
                        {% endif %}
                        {% if STRAVA %}
                        <a href="{{ INSTAGRAM }}" target="_blank"><div class="icon-instagram icon"></div></a>
                        {% endif %}
                        {% if STRAVA %}
                        <a href="{{ STRAVA }}" target="_blank"><div class="icon-strava icon"></div></a>
                        {% endif %}
                        {% if STRAVA %}
                        <a href="{{ TELEGRAM }}" target="_blank"><div class="icon-telegram icon"></div></a>
                        {% endif %}
                        {% if GOODREADS %}
                        <a href="{{ GOODREADS }}" target="_blank"><div class="icon-goodreads icon"></div></a>
                        {% endif %}
                        {% if FOURSQUARE %}
                        <a href="{{ FOURSQUARE }}" target="_blank"><div class="icon-foursquare icon"></div></a>
                        {% endif %}
                        {% if UNTAPPD %}
                        <a href="{{ UNTAPPD }}" target="_blank"><div class="icon-untappd icon"></div></a>
                        {% endif %}
                    </div>
                    <span id="busuanzi_container_page_pv" style="padding: 10px">本文阅读量<span id="busuanzi_value_page_pv"></span>次</span>
                    <span id="busuanzi_container_site_pv" style="padding: 10px">本站总访问量<span id="busuanzi_value_site_pv"></span>次</span>
                    <span id="busuanzi_container_site_uv" style="padding: 10px">本站总访客数<span id="busuanzi_value_site_uv"></span>人</span>
                    <p>© <script>document.write(moment().format('YYYY'));</script> {{ AUTHOR }}</p>
                    {% if ATTRIBUTION %} 
                    <p><i>"Brutal"</i> Pelican Theme</p>
                    <p>Designed and built by <a href="http://twitter.com/mcman_s">@mcman_s</a> in Denver</p>
                    {% endif %}
                </footer>
        {% endblock footer %}
        </div>
</body>
</html>
